<!--
 * @Author: lsmi
 * @Date: 2021-10-26 20:20:58
 * @LastEditors: lsmi
 * @LastEditTime: 2021-10-26 20:20:59
 * @FilePath: \v2_play_js\src\views\Audio.vue
-->
<!--  -->
<template>
  <div class="">
    <el-button @click="startRecorder">点击录音</el-button>
    <el-button @click="stopRecorder">停止录音</el-button>
    <el-button @click="playAction">play</el-button>
  </div>
</template>

<script>
import Recorder from "js-audio-recorder";
export default {
  components: {},
  data() {
    return {};
  },
  computed: {},
  watch: {},
  created() {
    this.recorder = new Recorder();
  },
  mounted() {},
  methods: {
    startRecorder() {
      this.recorder.start();
    },
    stopRecorder() {
      this.recorder.stop();
    },
    playAction() {
      this.recorder.play();
    },
  },
};
</script>
<style lang="scss" scoped>
//@import url();
</style>
